package cn.b.training.baby_education_training.repository;

import cn.b.training.baby_education_training.entity.BabyInoculate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: baby_education
 * @description
 * @author: wuying
 * @create: 2022-11-29 10:26
 **/
@Repository
public interface BabyInoculateRepository extends JpaRepository<BabyInoculate,Long> {
    @Query("select a from BabyInoculate a where a.babyId=?1")
    List<BabyInoculate> getInoculatesByBabyId(Long babyId);

    @Query("select a from BabyInoculate a where a.babyId=?1 and a.vaccineId=?2")
    List<BabyInoculate> getInoculatesByBabyIdAndVaccineId(Long babyId,Long vaccineId);


}
